package nku.csc364;

//Main Class to get all the timings

public class Main {

	public static void main(String... Args){
		/************************************************/
		//thousand elements
		int arrayElements = 1000;
		int temp = 0;
		
		Candidate[] array = new Candidate[arrayElements];
		Candidate[] array1 = new Candidate[arrayElements];
		Candidate[] array2 = new Candidate[arrayElements];
		while(temp < arrayElements){
			array[temp] = new Candidate();
			array1[temp] = new Candidate();
			array2[temp] = new Candidate();
			temp++;
		}
		long start = 0;
		long times[] = new long[12];
		//Sorting Candidate here... 
		start = System.currentTimeMillis();
		Sort.mergeSort(array);
		times[0] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.quickSort(array1);
		times[1] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.SelectionSort(array2);
		times[2] = System.currentTimeMillis()-start;
		System.out.println("I am done with 1000 elements");
		
		
		/************************************************/
		//ten thousand elements
		arrayElements = 10000;
		temp = 0;
		array = new Candidate[arrayElements];
		array1 = new Candidate[arrayElements];
		array2 = new Candidate[arrayElements];
		while(temp < arrayElements){
			array[temp] = new Candidate();
			array1[temp] = new Candidate();
			array2[temp] = new Candidate();
			temp++;
		}
		start = 0;
		
		//Sorting Candidate here... 
		start = System.currentTimeMillis();
		Sort.mergeSort(array);
		times[3] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.quickSort(array1);
		times[4] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.SelectionSort(array2);
		times[5] = System.currentTimeMillis()-start;
		System.out.println("I am done with 10000 elements");
		
		/************************************************/
		//hundred thousand elements
		arrayElements = 100000;
		temp = 0;
		array = new Candidate[arrayElements];
		array1 = new Candidate[arrayElements];
		array2 = new Candidate[arrayElements];
		while(temp < arrayElements){
			array[temp] = new Candidate();
			array1[temp] = new Candidate();
			array2[temp] = new Candidate();
			temp++;
		}
		start = 0;
		
		//Sorting Candidate here... 
		start = System.currentTimeMillis();
		Sort.mergeSort(array);
		times[6] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.quickSort(array1);
		times[7] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.SelectionSort(array2);
		times[8] = System.currentTimeMillis()-start;
		System.out.println("I am done with 100000 elements");
		
		/************************************************/
		//five hundred thousand elements
		
		arrayElements = 500000;
		temp = 0;
		array = new Candidate[arrayElements];
		array1 = new Candidate[arrayElements];
		array2 = new Candidate[arrayElements];
		while(temp < arrayElements){
			array[temp] = new Candidate();
			array1[temp] = new Candidate();
			array2[temp] = new Candidate();
			temp++;
		}
		start = 0;
		
		//Sorting Candidate here... 
		start = System.currentTimeMillis();
		Sort.mergeSort(array);
		times[9] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.quickSort(array1);
		times[10] = System.currentTimeMillis()-start;
		
		start = System.currentTimeMillis();
		Sort.SelectionSort(array2);
		times[11] = System.currentTimeMillis()-start;
		System.out.println("I am done with 500000 elements");
		
		System.out.println("/t, Merge Sort , Quick Sort , Selection Sort");
		System.out.println("1,000 , " + times[0] + " , " + times[1] + " , " + times[2] );
		System.out.println("10,000 , " + times[3] + " , " + times[4] + " , " + times[5] );
		System.out.println("100,000 , " + times[6] + " , " + times[7] + " , " + times[8] );
		System.out.println("500,000 , " + times[9] + " , " + times[10] + " , " + times[11] );
		
	}
	
}
